<?php /* Copyright 2010 Karl R. Wilcox 

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License. */


function makeOrd_subordinary($node) {
  $ord_data = array (
	  'baton' => array ( 'shape_spec' => array ( 'NC' => 'X900Y100b28D1131f56H1131b28', 'CH' => 'X800Y400b28D848f56H848b28' ),
                             'feature_size' => 18 ),
	  'baton-dexter' => array ( 'shape_spec' => array ( 'NC' => 'X100Y100h28B1131d56F1131h28', 'CH' => 'X200Y400h28B848d56F848h28' ),
                             'feature_size' => 18 ),
    'bordure' => array ( 'body' => array (
        'PLNC' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300 Z M 68.69,64.58 C 68.69,64.58 74.47,824.24 74.75,826.24 C 96.97,988.24 389.91,1092.92 496.99,1123.22 C 593.96,1094.94 914.82,998.29 925.29,826.24 C 925.50,822.90 927.32,64.58 927.32,64.58 L 68.69,64.58 z" />',
        'Q1NC' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300Z M66,66 L 934,66 934,1134 66,1134Z" />',
        'Q2NC' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300Z M66,66 L 934,66 934,1134 66,1134Z" />',
        'Q3NC' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300Z M66,66 L 66,400 A 1600 800 0 0,0 934,1134 L 934,66 Z" />',
        'Q4NC' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300Z M66,66 L 66,1134 A 1600 800 0 0,0 934,400 L 934,66 Z" />',
        'I1NC' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300Z M66,33 L 66,870 A 1450 850 0 0,0 934,1166 L 934,33 Z" />',
        'I2NC' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300Z M66,33 L 66,1166 A 1450 850 0 0,0 934,870 L 934,33 Z" />',
        'PLCH' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300 Z M 68.69,364.58 C 68.69,364.58 74.47,824.24 74.75,826.24 C 96.97,988.24 389.91,1092.92 496.99,1123.22 C 593.96,1094.94 914.82,998.29 925.29,826.24 C 925.50,822.90 927.32,64.58 927.32,364.58 L 68.69,364.58 z" />',
        'Q1CH' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300Z M66,366 L 934,366 934,1134 66,1134Z" />',
        'Q2CH' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300Z M66,366 L 934,366 934,1134 66,1134Z" />',
        'Q3CH' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300Z M66,366 L 66,400 A 1600 800 0 0,0 934,1134 L 934,366 Z" />',
        'Q4CH' => '<path fill-rule="evenodd" d="M-1001131.2u,-100 L 1100,-100 1100,1300 -100,1300Z M66,366 L 66,1134 A 1600 800 0 0,0 934,400 L 934,366 Z" />',
        'I1CH' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300Z M66,333 L 66,870 A 1450 850 0 0,0 934,1166 L 934,333 Z" />',
        'I2CH' => '<path fill-rule="evenodd" d="M-100,-100 L 1100,-100 1100,1300 -100,1300Z M66,333 L 66,1166 A 1450 850 0 0,0 934,870 L 934,333 Z" />')),
    'canton' => array ( 'shape_spec' => 'X-100Y-100a400C400E400g400', 'bounding_box' => '300,300' ),
  // TODO escutcheon smaller if overall?
    'inescutcheon' => array (
        'shape_spec' => array ( 'NC' => 'X200Y200A600C600I400,200,0,-300,200I400,200,0,-300,-200G600',  'CH' => 'X200Y500A600C300I400,200,0,-300,200I400,200,0,-300,-200G300'),
        'bounding_box' => array( 'NC' => '600,900,200,200', 'CH' => '600,500,200,500' )),
    'fret' => array ( 'body' => array (
        'NC' => '<path d="m 585,698 -57,57 -28,28 -283,-283 85,-85 57,57 -29,28 170,170 28,-29 57,57 z M 472,359 415,302 500,217 783,500 698,585 641,528 670,500 500,330 472,359 z M -16.6,-73.2 472,415 415,472 -73.2,-16.6 -16.6,-73.2 z M 585,528 l 495,492 -60,60 -492,-495 57,-57 z M 528,415 585,472 472,585 415,528 528,415 z M 302,641 358,698 -17,1070 -73.5,1020 302,641 z m 718,-714.5 50,56.5 -372,375 -57,-56 379,-375.5 z" />',
        'CH' => '<path d="m 585,948 -85,82 -283,-280 85,-85 57,57 -29,28 170,170 28,-29 57,57 z M 472,609 415,552 500,467 783,750 698,835 641,778 670,750 500,580 472,609 z M -16.6,177 472,665 415,722 -73.2,233 -16.6,177 z m 601.6,601 495,492 -60,60 -492,-495 57,-57 z M 528,665 585,722 472,835 415,778 528,665 z M 302,891 358,948 -17,1320 -73.5,1270 302,891 z m 718,-714 50,56 -372,375 -57,-56 379,-375 z" />')),
    'flaunch' => array ( 'shape_spec' => 'X-400Y-200a100I500,800,0,500,800I500,800,0,-500,800e100g1600',
       'bounding_box' => '200,1200' ),
    'square-flaunch' => array ( 'shape_spec' => array ( 'NC' => 'X-50Y-87K693L693m693j693', 'CH' => 'X-50Y113K693L693m693j693' ),
       'bounding_box' => array ( "NC" => '300,850', "CH" => '300,550,0,300' ) ),
    'gyron' => array ( 'shape_spec' => 'X-100Y-100B566E400g400', 'bounding_box' => '300,300' ),
    'gusset' => array ( 'shape_spec' =>  array( 'NC' => 'X-100Y-100B707C800e500g1400', 'CH' => 'X-100Y200B707C600e500g1100' ),
           'bounding_box' => array ( "NC" => '400,1200', "CH" => '400,900,0,300' ) ),
    'graft' => array ( 'shape_spec' => 'X-100Y500B707C300e500g800', 'bounding_box' => '400,600,0,600' ),
    'orle' => array( 'body' => array ( 'NC' => '<path fill-rule="evenodd" d="M 68.69,64.58 C 68.69,64.58 74.47,824.24 74.75,826.24 C 96.97,988.24 389.91,1092.92 496.99,1123.22 C 593.96,1094.94 914.82,998.29 925.29,826.24 C 925.50,822.90 927.32,64.58 927.32,64.58 L 68.69,64.58 z
        M 173.74,175.70 C 173.74,175.70 173.09,783.92 173.74,785.83 C 226.27,939.75 389.91,985.84 496.99,1016.15 C 593.96,987.86 759.26,949.80 828.32,785.83 C 829.62,782.75 828.32,175.70 828.32,175.70 L 173.74,175.70 z" />',
        'CH' => '<path fill-rule="evenodd" d="M 68.69,364.58 C 68.69,364.58 74.47,824.24 74.75,826.24 C 96.97,988.24 389.91,1092.92 496.99,1123.22 C 593.96,1094.94 914.82,998.29 925.29,826.24 C 925.50,822.90 927.32,364.58 927.32,364.58 L 68.69,364.58 z
        M 173.74,475.70 C 173.74,475.70 173.09,783.92 173.74,785.83 C 226.27,939.75 389.91,985.84 496.99,1016.15 C 593.96,987.86 759.26,949.80 828.32,785.83 C 829.62,782.75 828.32,475.70 828.32,475.70 L 173.74,475.70 z" />'), ),
    'pall' => array( 'shape_spec' => array ( 'NC' => 'X-100Y-200B848H848b141D889C800e141G800F889h141', 'CH' => 'X-100Y100B848H848b141D889C600e141G600F889h141' ),),
    'shakefork' => array( 'shape_spec' => array ( 'NC' => 'X100Y100a100B424H424a100c100D465C424d100f100G424F465g100', 'CH' => 'X200Y400a71B324H324a71c71D356C324d71f71G324F356g71' ),),
    'tressure' => array ( 'body' => array (
        'PLNC' => '<path fill-rule="evenodd" d="M 24.24,24.18 C 24.24,24.18 26.53,836.26 28.28,842.40 C 91.94,1065.58 383.85,1121.20 503.05,1171.71 C 619.15,1119.58 905.09,1067.45 967.72,852.50 C 968.85,848.62 971.76,26.20 971.76,26.20 L 24.24,24.18 z M 68.69,64.58 C 68.69,64.58 74.47,824.24 74.75,826.24 C 96.97,988.24 389.91,1092.92 496.99,1123.22 C 593.96,1094.94 914.82,998.29 925.29,826.24 C 925.50,822.90 927.32,64.58 927.32,64.58 L 68.69,64.58 z" />',
        'PLCH' => '<path fill-rule="evenodd" d="M 24.24,324.18 C 24.24,324.18 26.53,836.26 28.28,842.40 C 91.94,1065.58 383.85,1121.20 503.05,1171.71 C 619.15,1119.58 905.09,1067.45 967.72,852.50 C 968.85,848.62 971.76,326.20 971.76,326.20 L 24.24,324.18 z M 68.69,364.58 C 68.69,364.58 74.47,824.24 74.75,826.24 C 96.97,988.24 389.91,1092.92 496.99,1123.22 C 593.96,1094.94 914.82,998.29 925.29,826.24 C 925.50,822.90 927.32,364.58 927.32,364.58 L 68.69,364.58 z" />',
        'Q1NC' => '<path fill-rule="evenodd" d="M25,25 h950v1150h-950z M75,75 h850v1050h-850z" />',
        'Q1CH' => '<path fill-rule="evenodd" d="M25,325 h950v850h-950z M75,375 h850v750h-850z" />',
        'Q2NC' => '<path fill-rule="evenodd" d="M25,25 h950v1150h-950z M75,75 h850v1050h-850z" />',
        'Q2CH' => '<path fill-rule="evenodd" d="M25,325 h950v850h-950z M75,375 h850v750h-850z" />',
        'Q3NC' => '<path fill-rule="evenodd" d="M25,25 L25,500 A1550,850 0,0,0 975,1155 L 975,25Z M75,75 L 75,500 A1550,850 0,0,0 925,1105 L 925,75Z" />',
        'Q3CH' => '<path fill-rule="evenodd" d="M25,325 L25,500 A1550,850 0,0,0 975,1155 L 975,325Z M75,375 L 75,500 A1550,850 0,0,0 925,1105 L 925,375Z" />',
        'Q4NC' => '<path fill-rule="evenodd" d="M25,25 L25,1155 A1550,850 0,0,0 975,500 L 975,25Z M75,75 L 75,1105 A1550,850 0,0,0 925,500 L 925,75Z" />',
        'Q4CH' => '<path fill-rule="evenodd" d="M25,325 L25,1155 A1550,850 0,0,0 975,500 L 975,325Z M75,375 L 75,1105 A1550,850 0,0,0 925,500 L 925,375Z" />',
        'I1NC' => '<path fill-rule="evenodd" d="M25,13 L25,870 A1450,850 0,0,0 975,1168 L 975,13Z M75,50 L 75,870 A1450,850 0,0,0 925,1130 L 925,50Z" />',
        'I1CH' => '<path fill-rule="evenodd" d="M25,313 L25,870 A1450,850 0,0,0 975,1168 L 975,313Z M75,350 L 75,870 A1450,850 0,0,0 925,1130 L 925,350Z" />',
        'I2NC' => '<path fill-rule="evenodd" d="M25,13 L25,1168 A1450,850 0,0,0 975,870 L 975,13Z M75,50 L 75,1130 A1450,850 0,0,0 925,870 L 925,50Z" />',
        'PLNC' => '<path fill-rule="evenodd" d="M25,313 L25,1168 A1450,850 0,0,0 975,870 L 975,313Z M75,350 L 75,1130 A1450,850 0,0,0 925,870 L 925,350Z" />', ), ),
    'tressure2' => array ( 'body' => '<path fill-rule="evenodd" d="M 24.24,24.18 C 24.24,24.18 26.53,836.26 28.28,842.40 C 91.94,1065.58 383.85,1121.20 503.05,1171.71 C 619.15,1119.58 905.09,1067.45 967.72,852.50 C 968.85,848.62 971.76,26.20 971.76,26.20 L 24.24,24.18 z
        M 68.69,64.58 C 68.69,64.58 74.47,824.24 74.75,826.24 C 96.97,988.24 389.91,1092.92 496.99,1123.22 C 593.96,1094.94 914.82,998.29 925.29,826.24 C 925.50,822.90 927.32,64.58 927.32,64.58 L 68.69,64.58 z" />
        <path fill-rule="evenodd" d="M 123.23,115.09 C 123.23,115.09 122.96,783.83 123.23,785.83 C 145.46,947.83 389.91,1034.33 496.99,1064.63 C 593.96,1036.35 866.33,957.89 876.81,785.83 C 877.01,782.49 876.81,115.09 876.81,115.09 L 123.23,115.09 z
        M 173.74,175.70 C 173.74,175.70 173.09,783.92 173.74,785.83 C 226.27,939.75 389.91,985.84 496.99,1016.15 C 593.96,987.86 759.26,949.80 828.32,785.83 C 829.62,782.75 828.32,175.70 828.32,175.70 L 173.74,175.70 z" />', ),
    'fillet' => array ( 'shape_spec' => 'X-100Y325A1200c100E1200g100', ),
  );

  $name = $node->get_attribute('subtype');
  if ( isset($ord_data[$name]) ) {
    if ( is_array($ord_data[$name]) ) {
      $retval = $ord_data[$name];
    } else {
      $retval = array ( 'body' => $ord_data[$name] );
    }
  } else {
    my_trigger_error ( "No ordinary $name", E_USER_WARNING, __FILE__, __LINE__ );
    $retval = array ( 'body' => '<g/>');
  }
  return $retval;
}
?>
